import {defineStore} from "pinia"

export const cart = defineStore("cart",{
    state(){
        return {
            carts:[]
        }
    },
    getters:{
        total(state){
            return state.carts.reduce((total,item)=>{
                return total += item.count * item.price
            },0).toFixed(2)
        }
    }
})